home *** CD-ROM | disk | FTP | other *** search
- // commander.h
-
- #pragma once
- #define PILOT_PRECOMPILED_HEADERS_OFF
- #include <Pilot.h>
-
- class commander {
- public:
- static commander* s_top_commander;
- static commander* s_default_super;
-
- commander(commander* in_super);
- commander();
- virtual ~commander();
-
- // command handling
- static Boolean dispatch_command(int in_eventID, void* io_data);
- Boolean do_cmd (int in_eventID, void* io_data);
-
- // command chain handling
- static commander* get_top_commander() { return s_top_commander; };
- static void set_top_commander(commander* in_commander) { s_top_commander = in_commander; };
- static void set_default_commander(commander* in_commander) { s_default_super = in_commander; };
-
- protected:
- commander* m_super;
- commander* m_sub;
- commander* m_next;
-
- virtual Boolean do_cmd_self (int in_eventID, void* io_data) = 0; // pure virtual
-
- commander* get_sub() { return m_sub; };
- void set_sub(commander* in_sub) { m_sub=in_sub; };
-
-
- protected:
- void add();
- void remove();
-
- };